<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link th:href="@{/erp/assets/css/bootstrap.min.css}" rel="stylesheet"/>
    <link th:href="@{/erp/assets/css/bootstrap.min.css}" rel="stylesheet"/>
    <link rel="stylesheet" th:href="@{/erp/css/style.css}"/>
    <link th:href="@{/erp/assets/css/codemirror.css}" rel="stylesheet">
    <link rel="stylesheet" th:href="@{/erp/assets/css/ace.min.css}"/>
    <link rel="stylesheet" th:href="@{/erp/font/css/font-awesome.min.css}"/>
    <!--[if lte IE 8]>
    <link rel="stylesheet" th:href="@{/erp/assets/css/ace-ie.min.css}"/>
    <![endif]-->
    <script th:src="@{/erp/js/jquery-1.9.1.min.js}"></script>
    <script th:src="@{/erp/assets/js/bootstrap.min.js}"></script>
    <script th:src="@{/erp/assets/js/typeahead-bs2.min.js}"></script>
    <script th:src="@{/erp/assets/js/jquery.dataTables.min.js}"></script>
    <script th:src="@{/erp/assets/js/jquery.dataTables.bootstrap.js}"></script>
    <script th:src="@{/erp/assets/layer/layer.js}" type="text/javascript"></script>
    <script th:src="@{/erp/assets/laydate/laydate.js}" type="text/javascript"></script>
    <title>客户查询</title>
    <style type="text/css">
        .a1 {
            visibility: hidden;
        }
    </style>
</head>

<body>
<div class="margin clearfix">
    <div class="" id="Other_Management">
        <div class="search_style">
            <form>
            <ul class="search_content clearfix">
                <li><label class="l_f">企业名称:</label><input name="companyName" type="text" class="text_add" placeholder="输入企业名称"
                                                           style=" width:200px" id="companyName"></li>
                <li><label class="l_f">产品名称:</label><input name="companyBrand" type="text" class="text_add" placeholder="输入产品名称"
                                                           style=" width:200px" id="companyBrand"></li>
                <li style="width:100px;">
                    <button type="button" id="select" class="btn_search"><i class="fa fa-search"></i>查询</button>
                </li>
            </ul>
            </form>
        </div>
        <br/>

        <div class="list_style">
            <table class="table table-striped table-bordered table-hover" id="sample-table">
                <thead>
                <tr>

                    <th width="80">序号</th>
                    <th width="200">名称</th>
                    <th width="200">区域</th>
                    <th width="200">企业经营</th>
                    <th width="400">产品名称</th>
                    <th width="160">平台状态</th>
                    <th width="200">操作</th>
                    <th width="40" class="a1">企业ID</th>
                </tr>
                </thead>
                <tbody>
            <!--    <tr th:each="companies:${companies}">
                    <td th:text="${companiesStat.count}">1</td>
                    <td th:text="${companies.company.companyName}"></td>
                    <td th:text="${companies.company.companyProvince}+''+${companies.company.companyArea}">北京市大海区</td>
                    <td th:text="${companies.company.businessScope}"></td>
                    <td th:text="${companies.company.companyBrand}"></td>
                    <td class="td-status"><span class="label label-success radius">已认证</span></td>

                    <td><a href="clientele_details.html" title="查看详情" class="btn btn-xs btn-info "><i
                            class="fa fa-list  bigger-120"></i></a>
                    </td>
                    <td th:text="${companies.company.companyId}" class="a1"></td>
                </tr>-->

                </tbody>
            </table>
        </div>

    </div>
</div>
</div>
</body>
</html>
<script>


    $(function () {
        var table = $('#sample-table').dataTable({
            "autoWidth": false,
            searching:false,
            serverSide: true,   //开始服务器分页
            aoColumnDefs: [
                {"orderable": false, "aTargets": [ 1, 2, 3, 4, 5,6]}// 制定列不参与排序
            ],
            ajax: {
                url : '/customer/detailcompany',
                type : 'post',
                data : function (d) {
                    var data = $('form').serialize();   //获取查询条件

                    //获取分页信息
                    var searchParams= {
                        start : d.start,

                        length : d.length,
                    };
                    data = data + '&' + $.param(searchParams);
                    return data;
                }
            },
            columns : [
                { "data":"company.id","createdCell":function (td, cellData, rowData, row, col) {
                        $(td).empty().append(row+1);
                    }},
                { "data": "company.companyName" },
                { "data": function (td) {
                        return td.company.companyProvince+td.company.companyCity+td.company.companyArea;
                    }},
                { "data": "company.businessScope" },
                { "data": "company.companyBrand" },
                { "data": "company.companyStatus","createdCell":function (td, cellData, rowData, row, col) {
                        if(cellData=="on"){
                            $(td).empty().append('<span class="label label-success radius">已认证</span>')
                        }
                        else $(td).empty().append('<span class="label label-warning radius">未认证</span>')
                    }},
                { "data": "company.id" ,"createdCell":function (td, cellData, rowData, row, col) {
                        $(td).empty().append('<a href="/customer/detail2customer?customerId='+rowData.company.id+'&companyId='+rowData.company.id+'" title="查看" class="btn btn-xs btn-info "><i class="fa fa-list  bigger-120"></i></a>');
                    }}

            ]
        });

        //搜索按钮事件
        $('#select').click(function () {
            table.fnUpdate();
        });


        $('table th input:checkbox').on('click', function () {
            var that = this;
            $(this).closest('table').find('tr > td:first-child input:checkbox')
                .each(function () {
                    this.checked = that.checked;
                    $(this).closest('tr').toggleClass('selected');
                });

        });
    });


    function member_del(obj, id) {
        layer.confirm('确认忽略，这条信息不在当前页显示', function (index) {
            $(obj).parents("tr").remove();
            layer.msg('已删除!', {icon: 1, time: 1000});
        });
    }

    function integration_history(id) {
        layer.open({
            type: 1,
            title: '',
            area: [],
            shadeClose: true,
            content: $('#integration_history'),
        })
        $('#integration_history_list').dataTable({
            "aaSorting": [
                [1, "desc"]
            ],//默认第几个排序
            "bStateSave": true,//状态保存
            "aoColumnDefs": [{
                "bSortable": false,
                "orderable": false,
                "aTargets": [0, 1]
            }]
        });

    };

    function Browse_history(id) {
        layer.open({
            type: 1,
            title: '',
            area: [],
            shadeClose: true,
            content: $('#Browse_history'),
        })
        $('#Browse_history_list').dataTable({
            "aaSorting": [
                [1, "desc"]
            ],//默认第几个排序
            "bStateSave": true,//状态保存
            "aoColumnDefs": [{
                "bSortable": false,
                "orderable": false,
                "aTargets": [0, 1]
            }]
        });
    }


    function Order_history(id) {
        layer.open({
            type: 1,
            title: '',
            area: [],
            shadeClose: true,
            content: $('#Order_history'),
        });
        $('#Order_history_list').dataTable({
            "aaSorting": [
                [1, "desc"]
            ],//默认第几个排序
            "bStateSave": true,//状态保存
            "aoColumnDefs": [{
                "bSortable": false,
                "orderable": false,
                "aTargets": [0, 1]
            }]
        });
    }


</script>
